package Day07;

public class FoodText {
    public static void main(String[] args) {
        //创建一个对象数组
        Food[] arr = new Food[3];

        //创建三个商品对象
        Food f1 = new Food(001,"财富自由之路",56,88);
        Food f2 = new Food(002,"财富的真相",56,888);
        Food f3 = new Food(003,"把时间当朋友",56,8888);

        //把三个对象存到数组中去
        arr[0] = f1;
        arr[1] = f2;
        arr[2] = f3;

        //验证一下
        for (int i = 0; i < arr.length; i++) {
            Food food = arr[i];
            System.out.println(food.getId() +"," + food.getName()+
                    ", "+ food.getPrice() + ", " + food.getRemain());
        }
    }
}
